package com.yimi.yinhepda.entity.response;

import com.pda.ym.utils.DateHelper;

import java.util.List;

/**
 * @author 000432
 * @date 2017/4/14 0014
 *
 * 盘点---差异列表接口返回
 */

public class DifferTaskResponse {

  private List<DifferTaskEntity> data;
  private boolean success;
  private String[] errorMessages;
  private int errorCode;

  public List<DifferTaskEntity> getData() {
    return data;
  }

  public void setData(List<DifferTaskEntity> data) {
    this.data = data;
  }

  public boolean isSuccess() {
    return success;
  }

  public void setSuccess(boolean success) {
    this.success = success;
  }

  public String[] getErrorMessages() {
    return errorMessages;
  }

  public void setErrorMessages(String[] errorMessages) {
    this.errorMessages = errorMessages;
  }

  public int getErrorCode() {
    return errorCode;
  }

  public void setErrorCode(int errorCode) {
    this.errorCode = errorCode;
  }

  public static class DifferTaskEntity {
    /** 盘点差异编号 */
    private String diffreportNo;
    /** 少票 */
    private Integer lessNum;
    /** 库存区 */
    private String stockArea;
    /** 差异时间 */
    private String diffreportCreateTime;
    /** 盘点人 */
    private String stockUser;
    /** 状态 */
    private String diffreportStatus;
    /** radiobutton状态 */
    boolean isChecked;

    public boolean isChecked() {
      return isChecked;
    }

    public void setChecked(boolean checked) {
      isChecked = checked;
    }

    public String getDiffreportNo() {
      return diffreportNo;
    }

    public void setDiffreportNo(String diffreportNo) {
      this.diffreportNo = diffreportNo;
    }

    public Integer getLessNum() {
      if (lessNum == null) {
        lessNum = 0;
      }
      return lessNum;
    }

    public void setLessNum(Integer lessNum) {
      this.lessNum = lessNum;
    }

    public String getStockArea() {
      return stockArea;
    }

    public void setStockArea(String stockArea) {
      this.stockArea = stockArea;
    }

    public String getDiffreportCreateTime() {
      return diffreportCreateTime;
    }

    public void setDiffreportCreateTime(String diffreportCreateTime) {
      this.diffreportCreateTime = diffreportCreateTime;
    }

    public String getStockUser() {
      return stockUser;
    }

    public void setStockUser(String stockUser) {
      this.stockUser = stockUser;
    }

    public String getDiffreportStatus() {
      return diffreportStatus;
    }

    public void setDiffreportStatus(String diffreportStatus) {
      this.diffreportStatus = diffreportStatus;
    }

    /**
     * 差异时间的格式转换一下
     * 2017-03-31T06:22:57Z 去掉T和Z
     */
    public String getDifferTimeFormat(String diffreportCreateTime) {
      try {
        diffreportCreateTime = DateHelper.formatTimeEight(diffreportCreateTime);
      } catch (Exception e) {
        e.printStackTrace();
      }
      return diffreportCreateTime;
    }
  }
}
